package demo23.v2;

public class MyTimerTask implements Comparable<MyTimerTask>{
    public Runnable target;
    public long runAt; // 任务被放入定时器的时间 + delay
    public long delay;

    public MyTimerTask(Runnable target){
        this.target = target;
    }

    @Override
    public int compareTo(MyTimerTask o) {
        return (int)(this.runAt - o.runAt);
    }
}
